import { HTTP } from "./index"
export const user = '/iam/hzero/v1/users/self'
export const allUser =
  '/iam/hzero/v1/member-roles/self-roles'
export const tenant =
  '/iam/hzero/v1/users/self-tenants'
/**
 *
 * @returns 获取应用列表
 */
export function getAppList (roleId) {
  return HTTP({
     method:'post',
     url:"/hlod/v1/mobile/menu/tree",
     data:{
         roleId,
         functionIds: JSON.parse(process.env.VUE_APP_TARGET_FUNCTIONIDS),
     },
  })
}
/**
 *
 * @returns 获取用户信息
 */
export function getUserInfo () {
  return HTTP.get(user)
}
/**
 *
 * @returns 获取所有角色信息
 */
export function getAllRoles () {
  return HTTP.get(allUser)
}
/**
 *
 * @returns 获取所有租户信息
 */
export function getAllTenant () {
  return HTTP.get(tenant)
}
/**
 * 提交角色
 * @param {包含角色id的地址} url
 * @returns
 */
export function putRole (url) {
  return HTTP.put(url)
}
/**
 * 提交租户
 * @param {包含租户id的地址} url
 * @returns
 */
export function putTent (url) {
  return HTTP.put(url)
}
/**
 * 退出登录
 * @param {包含登录id的地址} url
 * @returns
 */
export function getExit (url) {
  return HTTP.get(url)
}

